﻿
@{
    ViewBag.Title = "Product Option Price Management";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="~/js/product.js"></script>
<script>
    $(document).ready(function() {
        loadDepartment();
        $(".div-stocked div label input.radio").on("click", function () {
            var value = $(".div-stocked div label input.radio:checked").val();
            $("#stocked").val(value);
        });
        $(".div-site div label input.radio").on("click", function () {
            var value = $(".div-site div label input.radio:checked").val();
            $("#onsite").val(value);
        });
    });
</script>
<style>
    input[type=radio] {
        margin: 0px;
        margin-right: 4px;
        display: block;
        float: left;
    }
    #departmentSelected a, #department a {
        padding-top: 3px;
        padding-left: 10px;
        margin-left: 0px;
        min-height: 10px;
        color: #333;
        cursor: pointer;
    }
    .de-selected {
        background-color: #e4e4e4;
    }
</style>
<div id="departmentFilter" class="modal hide fade" data-width="700" tabindex="-1" role="dialog" aria-labelledby="addController" aria-hidden="true">
    <div class="container-fluid">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h5>Department Filter</h5>
        </div>
        <div class="modal-body">
            <div class="row-fluid">
                <div class="span5">
                    <div class="fieldset">
                        <div id="department" class="container-fluid" style="height: 358px;overflow: auto;">
                        
                        </div>
                    </div>
                </div>
                <div class="span2">
                    <a onclick ='loadDepartment();' class="btn w90" style="margin-bottom: 30px; margin-top:10px;">Refresh</a>
                    <a class="btn btn-primary w90" style="margin-bottom: 10px;" onclick="addDepartment()">Add --></a>
                    <a class="btn btn-danger w90" style="margin-bottom: 10px;" onclick="removeDepartment()"><-- Remove</a>
                </div>
                <div class="span5">
                    <div class="fieldset">
                        <div id="departmentSelected" class="container-fluid" style="height: 358px;overflow: auto;">
                        
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="modal-footer">
            <button class="btn btn-primary w90" data-dismiss="modal" aria-hidden="true" onclick="submitModal()">OK</button>
            <button class="btn w90" data-dismiss="modal" aria-hidden="true">Close</button>
        </div>
    </div>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <fieldset>
            <legend>Search</legend>
            <form class="margin0" method="POST" action="/products/productoptpricefilter" id="fr-productoptprice">
                <input type="hidden" value="" name="deparmentfilter" id="hd-filter"/>
                <div class="row-fluid">
                    <div class="span3">
                        <div class="span6">ProductID</div>
                        <div class="span6">
                            <input type="text" class="input-block-level" name="productid" id="productid" />
                        </div>
                    </div>
                    <div class="span5">
                        <div class="span4">Product Name</div>
                        <div class="span8">
                            <input type="text" class="input-block-level" name="productname" id="productname" />
                        </div>
                    </div>
                    <div class="span4">
                        <div class="span3">Brands</div>
                        <div class="span9">
                            @Html.DropDownList("BrandID", null, new { @class = "input-block-level" })
                        </div>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span3">
                        <div class="span6">Product Option ID</div>
                        <div class="span6">
                            <input type="text" class="input-block-level" name="productoptionid" id="productoptionid" />
                        </div>
                    </div>
                    <div class="span5">
                        <div class="span4">Product Option Name</div>
                        <div class="span8">
                            <input type="text" class="input-block-level" name="productoptionname" id="productoptionname" />
                        </div>
                    </div>
                    <div class="span4">
                        <div class="span3">Supplier</div>
                        <div class="span9">
                            @Html.DropDownList("CompanyID", null, new { @class = "input-block-level" })
                        </div>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span4" style="margin-top: 17px;">
                        <div class="span3">Stores</div>
                        <div class="span9">
                            @Html.DropDownList("StoreID", null, new { @class = "input-block-level" })
                        </div>
                    </div>
                    <div class="span4">
                        <fieldset>
                            <legend>Stocked</legend>
                            <div class="margin0 div-stocked">
                                <div class="span4"><label><input type="radio" class="radio" name="rbtstocked" id="rbtStocked" value="1" />Stocked</label></div>
                                <div class="span4"><label><input type="radio" class="radio" name="rbtstocked" id="rbtDD" value="2" />DD</label></div>
                                <div class="span4"><label><input type="radio" class="radio" name="rbtstocked" id="rbtBoth" value="3" checked="checked"/>Both</label></div>
                                <input type="hidden" name="stocked" id="stocked" value="3"/>
                            </div>
                        </fieldset>
                    </div>
                    <div class="span4">
                        <fieldset>
                            <legend>Site</legend>
                            <div class="margin0 div-site">
                                <div class="span4"><label><input type="radio" class="radio" name="rbtsite" id="rbtOnsite" value="1" />On Site</label></div>
                                <div class="span4"><label><input type="radio" class="radio" name="rbtsite" id="rbtnotonsite" value="2" />Not On Site</label></div>
                                <div class="span4"><label><input type="radio" class="radio" name="rbtsite" id="rbtBoth2" value="3" checked="checked"/>Both</label></div>
                                <input type="hidden" name="site" id="onsite" value="3"/>
                            </div>
                        </fieldset>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span6">
                        <div class="span5">Suggest Retail (Set Min Margin %)</div>
                        <div class="span4"><input type="text" class="input-block-level" name="suggestretail" id="suggestretail"/></div>
                        <div class="span1" id="btnSet"><input type="button" class="btn btn-primary" onclick="setSuggestRetail()" value="Set"/></div>
                        <div class="span1" id="btnReset" style="display: none;"><input type="button" class="btn btn-primary" onclick="resetSuggestRetail()" value="ReSet"/></div>
                    </div>
                    <div class="span6 text-right" >
                        <a class="btn btn-primary" data-toggle="modal" href="#departmentFilter" id="btnDepartment">Filter Departments</a>
                        <input type="submit" class="btn btn-success" value="Search"/>
                        <input type="reset" class="btn btn-warning" value="Clear"/>
                    </div>
                </div>
            </form>
        </fieldset>
    </div>
    <div class="row-fluid productoptionresults">
                
    </div>
    <div class="row-fluid productoptionbreakdown">
        
    </div>
</div>
